﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data_Objects;

namespace ServicesComponent.Repositories
{
    public class UserRepository : IUserRepository
    {
        private static readonly IUserDao _user = DataAccess.UserDao;

        public List<Business_Objects.User> GetList()
        {
            return _user.GetUser().ToList();
        }

        public Business_Objects.User Get(string id)
        {
            return _user.GetUserByID(Convert.ToInt32(id));
        }

        public void Insert(Business_Objects.User t)
        {
            _user.InsertUser(t);
        }

        public void Update(Business_Objects.User t)
        {
            _user.UpdateUser(t);
        }

        public void Delete(Business_Objects.User t)
        {
            _user.DeleteUser(t);
        }

        public List<Business_Objects.User> GetUserBySchoolId(int schoolId)
        {
            return _user.GetUserBySchoolId(schoolId).ToList();
        }




        public Business_Objects.User GetUserByUserNameAndPassword(string username, string password)
        {
            return _user.GetUserByUserNameAndPassword(username, password);
        }
    }
}
